#include <QCoreApplication>
#include <QDebug>

#include "SimpleRemoteControl.h"
#include "Light.h"
#include "LightOnCommand.h"

#include "GargeDoor.h"
#include "GargeDoorOpenCommand.h"

#include "RemoteControl.h"

#define SAVE_DELETE_PTR(ptr) { if(nullptr != ptr) { delete ptr; ptr = nullptr;}}

void RemoteControlTestFun()
{
    SimpleRemoteControl *remote = new SimpleRemoteControl();
    Light *light = new Light();
    LightOnCommand *lightOn = new LightOnCommand(light);

    remote->setCommand(lightOn);
    remote->buttonWasPressed();

    SAVE_DELETE_PTR(lightOn);
    SAVE_DELETE_PTR(light);
    SAVE_DELETE_PTR(remote);
}

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    RemoteControlTestFun();
    return a.exec();
}
